package com.yxt.admin.controller;

import com.yxt.admin.entity.SysDictData;
import com.yxt.admin.service.ISysDictDataService;
import com.yxt.admin.service.ISysDictTypeService;
import com.yxt.admin.utils.SecurityUtils;
import com.yxt.common.annotation.Log;
import com.yxt.common.enums.BusinessType;
import com.yxt.common.utils.ajax.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * 数据字典信息
 * 
 */
@RestController
@RequestMapping("/admin/dict/data")
public class SysDictDataController
{
    @Autowired
    private ISysDictDataService dictDataService;

    @Autowired
    private ISysDictTypeService dictTypeService;

    /**
     * 根据字典类型查询字典数据信息
     */
    @GetMapping(value = "/type/{dictType}")
    public R dictType(@PathVariable String dictType)
    {
        return R.ok().put("data",dictTypeService.selectDictDataByType(dictType));
    }

}
